package com.benny_driving_dri.thread;

import com.benny_driving_dri.dao.impl.HttpDaoImpl;
import com.benny_driving_dri.service.TaximeterSer;

public class GetTimeThread extends Thread {
	int opp;
	String jsession;

	private GetTimeThread() {
	}

	private static class GetTimeThreadHolder {
		private static GetTimeThread instance = new GetTimeThread();
	}

	public static GetTimeThread getInstance() {
		return GetTimeThreadHolder.instance;
	}

	public void setOpp(String jession, int opp) {
		this.jsession = jession;
		this.opp = opp;
	}

	@Override
	public void run() {
		long resData = new HttpDaoImpl().getTime(jsession);
		if (null != TaximeterSer.handler)
			TaximeterSer.handler.sendMessage(TaximeterSer.handler
					.obtainMessage(TaximeterSer.TM_CTRL_RESPONSE, opp, 2,
							resData));
	}

}
